/*
 * @Author: xiawei 1243162387@qq.com
 * @Date: 2024-04-02 08:47:54
 * @LastEditors: xiawei 1243162387@qq.com
 * @LastEditTime: 2024-11-15 00:01:49
 */
import { http, HttpResponse  } from 'msw';
import { faker } from '@faker-js/faker';

const baseUrl = '';

export default [
  http.post(`${baseUrl}/login`, () => {
    return HttpResponse.json({
      errors: null,
      code: 20000,
      message: '登录成功。',
      result: {
          id:  faker.string.uuid(),
          username: faker.internet.userName(),
          createTime: faker.date.past(),
          token: faker.string.uuid(),
      },
      success: true,
    })

  }),
  http.get(`${baseUrl}/getUserInfoById`, (PathParams) => {
    return HttpResponse.json({
      errors: null,
      code: 20000,
      message: '获取用户信息成功。',
      result: {
          id:  faker.string.uuid(),
          username: faker.internet.userName(),
          createTime: faker.date.past(),
          avatar: faker.image.avatar(),
          token: faker.string.uuid(),
          birthdate: faker.date.birthdate(),
          email: faker.internet.email(),
          menus: ['/microApp/vue2-app','/microApp/vue3-vite-app','/microApp/setting-app']
      },
    })

  })
];